#ifndef CONNECTIONPLAYER_H
#define CONNECTIONPLAYER_H

#include <QString>
#include <QtCore/QList>
#include <QtCore/QPoint>
#include "connection.h"
#include <QtCore/QtCore>

class ConnectionPlayer : public Connection
{
	Q_OBJECT
public:
	ConnectionPlayer(QHostAddress a, quint16 p, bool onlyReceive = false);
	ConnectionPlayer(bool onlyReceive = false);

    void setNick(QString n);
    void setScore(quint16 n);
    void setPlayerId(quint8 n);
    void setPosition(QPointF pos);
	void setIsAlive(bool isAlive);
	void setIsReloading(bool isReloading);
	void setAngle(qint16 angle);
	void setDirs(quint8 d1, quint8 d2);
	void fireGun(qreal, qreal, qreal);

    QString getNick();
    quint16 getScore();
    quint8 getPlayerId();
    QPointF getPos();
    bool getIsAlive();
    bool getIsReloading();
    qint16 getAngle();

    QVector<quint8> dirs;
protected:

    QString nick;
    quint8 player_id;
    quint16 score;
    qint16 angle;
    bool isAlive;
    bool isReloading;
    QPointF pos;
signals:
    void scoreChanged(quint16);
	void positionChanged(QPointF);
	void isAliveChanged(bool);
	void isReloadingChanged(bool);
	void angleChanged(qint16);
	void dirsChanged(quint8, quint8);
	void gunFired(qreal,qreal,qreal);
};

#endif // CONNECTIONPLAYER_H
